<?php
namespace Home\Controller;
use Home\Controller\CommonController;
class IndexController extends CommonController {

    /**
      +----------------------------------------------------------
     * 首页
     *
      +----------------------------------------------------------
     */
    public function index() {
        //  if(isset($_SESSION['userid'])){
        //   $user=M('user')->where('id='.$_SESSION['userid'])->find();
        //   $content=$user['content'];
        // if(!empty($content)){
        //   $map['cid']  = array('in',$content);
        // }
        //   else{
        //    $map['cid']=''; 
        //   }
        //   $fenlei=M('category')->where($map)->select();
        //  foreach ($fenlei as  &$value) {
        //  $erji=M('category')->where('pid='.$value['cid'])->select();
        //            $value['erji']=$erji;
                 
        //  }}   
    
         $cid=I('get.cid');
         if(!empty($cid)){
        $shangpin=M('shangpin')->where('cid='.$cid)->select();

}

    $li=M('sylunbo');
        $roll=$li->order('id desc')->limit(5)->select();

 
        $this->assign('roll',$roll);
    $this->assign("shangpin",$shangpin);
         //$this->assign("fenlei",$fenlei);
 
       
         $this->display();
    }












}
 
?>